const express = require('express')

const {
	submitBug,
	bugList,
} = require('../modules/module-bug')

const router = express.Router()

// /ult/bug/submit
router.post('/bug/submit', function(req, res, next) {
	return submitBug(req.body).then(result => {
		return res.type('json').send(result)
	})
})

// /ult/bug/list
router.post('/bug/list', function(req, res, next) {
	return bugList().then(result => {
		return res.type('json').send(result)
	})
})

module.exports = router